package io.github.jast90.internship.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.github.jast90.common.entity.BaseEntity;

/**
 * Created by jast90 on 2021/3/8
 */
@ColumnWidth(25)
public class User extends BaseEntity {

    @ExcelProperty("用户名")
    private String username;
    @ExcelIgnore
    private String password;
    @ExcelProperty("用户类型，取值 1：管理员 2：教师 3：学生")
    private byte userType;
    @ExcelProperty("真实姓名")
    private String realName;
    @ExcelProperty("年龄")
    private int age;
    @ExcelProperty("班级编号，取值 班级id")
    private Long classId;
    private String className;
    @JsonIgnore
    private Long teacherId;
    @JsonIgnore
    private Long studentId;

    public String getUserTypeDesc(){
        String result = "";
        switch (getUserType()){
            case 1: result = "管理员"; break;
            case 2: result = "教师"; break;
            case 3: result = "学生"; break;
        }
        return result;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public byte getUserType() {
        return userType;
    }

    public void setUserType(byte userType) {
        this.userType = userType;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Long getClassId() {
        return classId;
    }

    public void setClassId(Long classId) {
        this.classId = classId;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public Long getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(Long teacherId) {
        this.teacherId = teacherId;
    }

    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }
}
